package edu.yuhf.domain;

import com.yuhf.dbutils.iface.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

public class StudentMapper implements RowMapper<Student> {
    @Override
    public Student handler(ResultSet rs) throws SQLException {
        Student student = new Student();
        try {
            student.setId(rs.getInt("id"));
            student.setSno(rs.getString("sno"));
            student.setName(rs.getString("name"));
            student.setSex(rs.getString("sex"));
            student.setBirthday(rs.getDate("birthday"));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return student;
    }
}
